<template>
	<view class="content">
		<scroll-view  scroll-y style="height: 100%;">
			<template v-if="lineHazardList.length>0">
				<view class="list-item" v-for="(item, index) in lineHazardList" :key="index">
					<view class="item-row">
						<view class="title">{{$t('inspection.area.hazard')}}</view>
						<view class="mes">{{item.hazard}}</view>
					</view>
					<view class="item-row">
						<view class="title">{{$t('inspection.area.pvnMeasure')}}</view>
						<view class="mes">{{item.pvnMeasure}}</view>
					</view>	
				</view>
			</template>	
			<template v-if="lineHazardList.length==0">
				<u-empty icon="../../../static/images/empty_data.png" />
			</template>
		</scroll-view>
	</view>
</template>

<script>
	import { getLineInfo } from '@/api/business/inspect.js'
	
	export default {
		data() {
			return {
				lineId: '',
				lineHazardList: []
			}
		},
		onLoad(option) {
			this.lineId = option.lineId
			this.init()
		},
		methods: { 
			init() {
				getLineInfo({ lineId: this.lineId }).then((res) => {
					if (!res) {
						return
					}
					this.lineHazardList = res.data.lineHazardList
				})
			}
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #F1F1F1;
	}
		
	.list-item {
		background: white;
		margin: 10px auto;
		margin-bottom: 15px;
		font-size: 14px;
		
		.item-row {
			border-bottom: 1rpx solid #eee;
			line-height: 40px;
			display: flex;
			
			.title {
				width: 80px;
				text-align: center;
				color: #999;
				border-right: 1rpx solid #eee;
			}
			
			.mes {
				margin-left: 10px;
			}
		}
	}
</style>